define(()=>{
    return function(){

$(".headerBox").load("http://localhost:3000/public/header.html .dyb_header", function () {
    const ologin = document.getElementById("login");
    const ogoCart = document.querySelector(".intop-right2");
    const oexit = document.querySelector(".exit");
    const owelcome = document.querySelector(".welcome");
    if (localStorage.getItem("isLogin") === "ok") {

        ologin.style.display = "none";
        owelcome.style.display = "block";
    } else {
        ologin.style.display = "block";
        owelcome.style.display = "none";
    }

    oexit.onclick = function () {
        localStorage.removeItem("username");
        localStorage.setItem("isLogin", "");
        ologin.style.display = "block";
        owelcome.style.display = "none";
    }

    ogoCart.onclick = function () {
        if (localStorage.getItem("isLogin") === "ok") {
            location.href = "../cart.html";
        } else {
            alert("未登录状态，不允许打开购物车，请先去登陆");
            location.href = "../logon.html";
        }
    }
})
$(".footerBox").load("http://localhost:3000/public/header.html .dyb-footer")

$(function () {
    $(".headerBox").on("mouseenter", ".hovers1", function () {
        $(".show1").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers1", function () {
        $(".show1").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".hovers2", function () {
        $(".show2").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers2", function () {
        $(".show2").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".hovers3", function () {
        $(".show3").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers3", function () {
        $(".show3").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".hovers4", function () {
        $(".show4").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers4", function () {
        $(".show4").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".hovers5", function () {
        $(".show5").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers5", function () {
        $(".show5").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".hovers6", function () {
        $(".show6").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".hovers6", function () {
        $(".show6").css("display", "none")
    })
})

$(function () {
    // $(".appear").hover(function(){
    //     $(this).children(".second-child").show()
    // },function(){
    //     $(this).children(".second-child").hide()
    // })
    $(".headerBox").on("mouseenter", ".appear", function () {
        $(".second-child").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear", function () {
        $(".second-child").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear2", function () {
        $(".appearshow1").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear2", function () {
        $(".appearshow1").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear3", function () {
        $(".appearshow2").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear3", function () {
        $(".appearshow2").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear4", function () {
        $(".appearshow3").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear4", function () {
        $(".appearshow3").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear5", function () {
        $(".appearshow4").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear5", function () {
        $(".appearshow4").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear6", function () {
        $(".appearshow5").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear6", function () {
        $(".appearshow5").css("display", "none")
    })
    $(".headerBox").on("mouseenter", ".appear7", function () {
        $(".appearshow6").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".appear7", function () {
        $(".appearshow6").css("display", "none")
    })
})


$(".ewm").hover(function () {
    $(".qrcode").toggle()
})
$(function () {
    $(".headerBox").on("mouseenter", ".classification", function () {
        $("#secondlevel").css("display", "block")
    })
    $(".headerBox").on("mouseleave", ".classification", function () {
        $("#secondlevel").css("display", "none")
    })
})
    }
})